import {EstateAgent} from './Agent';
import {HouseOwner, Tenant} from './Customers';
import separate from '../patternSeparator';

separate('中介者模式');

let agent = new EstateAgent();
let houseOwner = new HouseOwner("Shit", agent);
let tenant = new Tenant("Me", agent);

agent.setHouseOwner(houseOwner);
agent.setTenant(tenant);

console.log('房客发出消息');
tenant.contact('听说你有房子？');
console.log('房东发出消息');
houseOwner.contact('没错！你租不租？');